package com.tjbklx1.pattern.singleton.demo1;

/**
 * 最简单的单例模式
 * @author tjbklx1
 * @date 2018-10-10
 */
public class Emperor {
	private Emperor() {
	}
	//启动后就创建对象
	private final static Emperor instance = new Emperor();

	//没有同步代码块
	public static Emperor getInstance() {
		return instance;
	}

	public void say() {
		System.out.println("I am Emperor xxx");
	}
}
